package cn.proandcus;

/**
 * 消费者
 */
public class Customer  implements  Runnable{
    private Box box;
    public Customer(Box box){
        this.box=box;
    }
    @Override
    public void run() { //加锁

       while (true){
           try {
               box.getMilk();//消费者消费
           } catch (InterruptedException e) {
               e.printStackTrace();
           }
       }
    }
}
